<template>
  <!--积分兑换记录-->
  <div>
    <div class="search">
      <input type="text" placeholder="搜索名称/关键字" v-model="title">
      <img src="../../../assets/search.png" alt="" width="16" @click="goSearch(title)">
    </div>
    <ul class="list">
      <li v-for="item in balanceLogList">
        <ul>
          <li>{{item.title}}</li>
          <li>{{item.createDate}}</li>
        </ul>
        <span class="nouse" v-if="item.useState==1">待使用</span>
      </li>
    </ul>
  </div>
</template>

<script type="text/ecmascript-6">
  import {exchangeGoodsLog} from '../../../../test/unit/http'
  import {Toast} from 'we-vue'
  export default {
    name: '',
    props: {},
    data() {
      return {
        balanceLogList: [],
        title:""
      };
    },
    methods: {
      getExchangeGoodsLogData(params) {
        var that=this;
        exchangeGoodsLog(params).then(res => {
          if (res.code == 100) {
            that.balanceLogList = res.object;
          }
        })
      },
      goSearch(title){
        let params={title:title};
        this.getExchangeGoodsLogData(params);
      }
    },
    created() {
      this.getExchangeGoodsLogData({});
      console.log(this.balanceLogList)
    },
    components: {}
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less" rel="stylesheet/less">
  input::-webkit-input-placeholder {
    color: #999;
    font-size: 14px;
  }

  .search {
    position: relative;
    width: 95%;
    margin: 10px auto;
    input {
      width: 90%;
      border: 1px solid #eee;
      box-shadow: 0 3px 4px rgba(17, 17, 17, 0.05);
      border-radius: 7px;
      height: 43px;
      line-height: 43px;
      padding: 10px;
      color: #111;
    }

    img {
      position: absolute;
      right: 20px;
      top: 27px;
    }
  }

  .list > li {
    display: flex;
    text-align: left;
    padding: 10px;
    > ul {
      flex: 0 80%;
      li:first-child {
        font-size: 15px;
        color: #111;
      }
      li:last-child {
        font-size: 12px;
        color: #999;
      }

    }
    > span {
      width: 20%;
      text-align: center;
      font-size: 15px;
    }
    .nouse {
      color: #2e94f0;
    }
    .yiuse {
      color: #999;
    }
  }
</style>
